Skip to content

hotfix: fix broken state swaps#3278

Merged
svenvoskamp merged 20 commits intomainfrom
fix/swaps
Nov 19, 2024
Merged

hotfix: fix broken state swaps#3278
svenvoskamp merged 20 commits intomainfrom
fix/swaps

Conversation

@svenvoskamp
Copy link
Contributor

@svenvoskamp svenvoskamp commented Nov 19, 2024

Description

hotfix: fix broken state swaps

Type of change

  • Chore (non-breaking change that addresses non-functional tasks, maintenance, or code quality improvements)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Associated Issues

Closes APKT-xxx

Showcase (Optional)

If there is a UI change include the screenshots with before and after state.
If new feature is being introduced, include the link to demo recording.

Checklist

  • Code in this PR is covered by automated tests (Unit tests, E2E tests)
  • My changes generate no new warnings
  • I have reviewed my own code
  • I have filled out all required sections
  • I have tested my changes on the preview link
  • Approver of this PR confirms that the changes are tested on the preview link

@changeset-bot
Copy link

changeset-bot bot commented Nov 19, 2024

🦋 Changeset detected

Latest commit: 4982e7a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 20 packages
Name Type
@reown/appkit-adapter-wagmi Patch
@reown/appkit-core Patch
@apps/demo Patch
@apps/gallery Patch
@apps/laboratory Patch
@reown/appkit-adapter-ethers Patch
@reown/appkit-adapter-ethers5 Patch
@reown/appkit-adapter-polkadot Patch
@reown/appkit-adapter-solana Patch
@reown/appkit Patch
@reown/appkit-utils Patch
@reown/appkit-cdn Patch
@reown/appkit-common Patch
@reown/appkit-experimental Patch
@reown/appkit-polyfills Patch
@reown/appkit-scaffold-ui Patch
@reown/appkit-siwe Patch
@reown/appkit-siwx Patch
@reown/appkit-ui Patch
@reown/appkit-wallet Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Nov 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
appkit-gallery-new 🛑 Canceled (Inspect) Nov 19, 2024 6:23pm
appkit-laboratory ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 19, 2024 6:23pm
appkit-vue-solana ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 19, 2024 6:23pm
appkit-wagmi-cdn-example 🛑 Canceled (Inspect) Nov 19, 2024 6:23pm
vue-wagmi-example 🛑 Canceled (Inspect) Nov 19, 2024 6:23pm

@github-actions
Copy link
Contributor

github-actions bot commented Nov 19, 2024

Coverage Report for Coverage

Status Category Percentage Covered / Total
🔵 Lines 335.27% 4822 / 23621
🔵 Statements 335.27% 4822 / 23621
🔵 Functions 368.54% 387 / 1430
🔵 Branches 474.44999999999993% 741 / 1721
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/core/src/controllers/SwapController.ts 45.32% 61.53% 56.66% 45.32% 40-43, 166-167, 170-171, 180-181, 211-216, 242, 250-252, 261-265, 269-284, 287-300, 311-312, 315-316, 320-321, 329-332, 365, 372, 377-396, 405-407, 420-421, 432-433, 445, 452-453, 457-465, 493-494, 516-517, 531, 540-579, 582-640, 643-694, 698-735, 738-824, 840, 856-857
Generated in workflow #7450 for commit 4982e7a by the Vitest Coverage Report Action

availableToSwap:
caipAddress && !invalidToToken && !invalidSourceToken && !invalidSourceTokenAmount,
isAuthConnector: type === 'AUTH'
isAuthConnector: type === 'ID_AUTH'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was 'AUTH' stil a valid type?

Copy link
Contributor Author

@svenvoskamp svenvoskamp Nov 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AUTH and ID_AUTH shares the type: ConnectorType

authConnectorId = ID_AUTH
authConnectorType = AUTH

This is confusing, so we should definitely improve this

availableToSwap:
caipAddress && !invalidToToken && !invalidSourceToken && !invalidSourceTokenAmount,
isAuthConnector: type === 'AUTH'
isAuthConnector: type === 'ID_AUTH'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we maybe add ID_AUTH to a constants file ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be type checked already else it'd say that it would always be false 🤔
but we should use the constant regardless IMO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants